﻿<Common:BasePhoneAppPage
    x:Class="IkeCode.WP7.Wakeup.Views.SelectDaysPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Common="clr-namespace:IkeCode.WP7.Wakeup.Common"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:bar="clr-namespace:BindableApplicationBar;assembly=BindableApplicationBar"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True"
    DataContext="{Binding SelectDays, Source={StaticResource Locator}}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRootSelectDays" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="PageTitle" Text="{Binding Path=SelectDays, Source={StaticResource AppDictionary}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox>
                <CheckBox IsChecked="{Binding MondayIsChecked, Mode=TwoWay}" Content="{Binding Path=Monday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding TuesdayIsChecked, Mode=TwoWay}" Content="{Binding Path=Tuesday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding WednesdayIsChecked, Mode=TwoWay}" Content="{Binding Path=Wednesday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding ThursdayIsChecked, Mode=TwoWay}" Content="{Binding Path=Thursday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding FridayIsChecked, Mode=TwoWay}" Content="{Binding Path=Friday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding SaturdayIsChecked, Mode=TwoWay}" Content="{Binding Path=Saturday, Source={StaticResource AppDictionary}}"/>
                <CheckBox IsChecked="{Binding SundayIsChecked, Mode=TwoWay}" Content="{Binding Path=Sunday, Source={StaticResource AppDictionary}}"/>
            </ListBox>
        </Grid>
    </Grid>

    <bar:Bindable.ApplicationBar>
        <bar:BindableApplicationBar>
            <bar:BindableApplicationBarButton
                IconUri="/LocalResources/Images/appbar.check.png"
                Text="{Binding Path=Ok, Source={StaticResource AppDictionary}}"
                Command="{Binding BackCommand}" />
            <bar:BindableApplicationBar.MenuItems>
                <bar:BindableApplicationBarMenuItem
                    Command="{Binding BarSpecialCommand}" 
                    CommandParameter="0" IsEnabled="{Binding CheckAllIsEnabled, Mode=TwoWay}"
                    Text="{Binding Path=AllDays, Source={StaticResource AppDictionary}}" />
                <bar:BindableApplicationBarMenuItem
                    Command="{Binding BarSpecialCommand}" 
                    CommandParameter="1"
                    Text="{Binding Path=BusinessDays, Source={StaticResource AppDictionary}}" />
                <bar:BindableApplicationBarMenuItem
                    Command="{Binding BarSpecialCommand}" 
                    CommandParameter="2"
                    Text="{Binding Path=Weekend, Source={StaticResource AppDictionary}}" />
                <bar:BindableApplicationBarMenuItem
                    Command="{Binding BarSpecialCommand}" 
                    CommandParameter="3" IsEnabled="{Binding UncheckAllIsEnabled, Mode=TwoWay}"
                    Text="{Binding Path=UncheckAll, Source={StaticResource AppDictionary}}" />
            </bar:BindableApplicationBar.MenuItems>
        </bar:BindableApplicationBar>
    </bar:Bindable.ApplicationBar>
</Common:BasePhoneAppPage>
